<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>注册</title>
		<link href="/static/lvshi_pc/css/person.css" rel="stylesheet" />
		<link href="/static/lvshi_pc/css/swiper-bundle.min.css" rel="stylesheet" />
		<link href="/static/lvshi_pc/css/animate.min.css" rel="stylesheet" />
		<link href="/static/lvshi_pc/css/reset.min.css" rel="stylesheet" />
		<script src="/static/lvshi_pc/js/swiper-bundle.min.js"></script>
		<script src="/static/lvshi_pc/js/jquery.min.js"></script>
		<script src="/static/lvshi_pc/js/wow.min.js"></script>
		<script src="/static/lvshi_pc/js/changeWindow.js"></script>
		<script src="/static/layer/layer.js"></script>
		<script src="/static/global/js/global.js"></script>
		<script src="/static/elementUi/axios.min.js"></script>
		<script src="/static/elementUi/Api.js"></script>
		<script src="/static/elementUi/vue@2.6.14.js"></script>
	</head>
	<body>
		<header>
			{include file="public/header"}
		</header>
		<div class="lobg">
			<div class="wrap" id="app">
				<div class="dengbox">
						<div class="dengbai">
							<div class="detitle">注册</div>
							<div class="dehui">
								<img src="/static/lvshi_pc/images/da_03.png" class="dapic" alt="">
								<input type="text" v-model="register_data.nick" class="deput" placeholder="请输入真实姓名">
							</div>
							<div class="dehui">
								<img src="/static/lvshi_pc/images/db_03.png" class="dapic" alt="">
								<input type="text" v-model="register_data.tel" class="deput" placeholder="请输入手机号">
							</div>
							<div class="dehui">
								<img src="/static/lvshi_pc/images/dc_03.png" class="dapic" alt="">
								<input type="password" v-model="register_data.password" class="deput" placeholder="请输入密码">
							</div>
							<div class="dehui" style="margin-bottom: 0;">
								<img src="/static/lvshi_pc/images/dc_03.png" class="dapic" alt="">
								<input type="password" v-model="register_data.password_confirm" class="deput" placeholder="请确认密码">
							</div>
							<div class="majie">
								密码长度8-32位，须包含数字、字丹、符号至少2种或以上元素
							</div>
							<div class="dehui">
								<img src="/static/lvshi_pc/images/db_03.png" class="dapic" alt="">
								<input type="text" v-model="register_data.code" class="huoput" name="code" placeholder="请输入验证码">
								<div class="desub" @click="sendSms" v-if="!is_send">获取验证码</div>
								<div class="desub"  v-else>{{timeer}}</div>
							</div>
							
							<a href="javascript:;">
								<div class="lubut mt50" @click="submit">确认注册</div>
							</a>
						</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			let vs
			var vm = new Vue({
				el:"#app",
				data:function () {
					return {
						register_data:{},
						timeer:120,
						is_send:false
					}
				},
				created(){
					vs = this
				},
				methods:{
					submit() {
						Api.my('/index/index/register',this.register_data).then(res=>{
							if (res.code == 1) {
								showSuccessMsgCall('注册成功',(res)=>{
									location.href = "/index/index/password"
								})
							} else {
								showErrMsg(res.msg)
							}
						})
					},
					sendSms() {
						vs.register_data.flag = "{:session('regflag')}"
						Api.my("/index/index/sendSms",this.register_data).then(res=>{
							console.log(res)
							if (res.code == 1) {
								vs.doTime()
								vs.is_send = true
								showSuccessMsg('发送成功')
							} else {
								showErrMsg(res.msg)
							}
						})
					},
					doTime() {
						let t = setInterval(()=>{
							vs.timeer --
							if (vs.timeer <= 0) {
								clearInterval(t)
								vs.timeer = 120
								vs.is_send = false
							}
						},1000)
					}
				}
			})
			// wow效果启用
			new WOW().init();
		</script>
	</body>

</html>
